package com.roncoo.student.stu.controller;


import com.roncoo.student.stu.entity.WebStudents;
import com.roncoo.student.stu.service.IWebStudentsService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jl
 * @since 2021-03-22
 */

@RestController
@RequestMapping("/stu/web-students")
public class WebStudentsController {

    @Resource
    private IWebStudentsService studentsService;

    /*
    * 查询学员信息
    * */
    @GetMapping("/findAll")
    public IPage<Map> findAll(WebStudents webStudents, Page page){
        System.out.println(webStudents);
        IPage<Map> all = studentsService.findAll(webStudents, page);

        return all;
    }

    /*
    * 修改学员信息
    * */

    @PostMapping("/updStudent")
    public Boolean updStudent(WebStudents webStudents){
        System.out.println(webStudents+"==============");
    return studentsService.updateById(webStudents);

    }

}

